package com.zhentao.day04.pm;

import com.zhentao.day04.am.User;

public class UserTest extends User {
  public static void main(String[] args) {
    User1 user1 = new User1();
    user1.name ="zs";
    User1 user2 = new User1() ;
    user2.name = "zs";

    // 此时比较的是两个对象的地址是否相等。
    System.out.println("user1.equals(user2) = " + user1.equals(user2));
    System.out.println("user1 = " + user1);//user1 = com.zhentao.day04.pm.User1@568db2f2
    System.out.println("user2 = " + user2);//user2 = com.zhentao.day04.pm.User1@378bf509

  }
}

class User1{
  String name ;

  // 对Object类的toString方法进行重写
  @Override
  public String toString() {
    return " name = " + name ;
  }
}